package com.cjm.one.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.constant.SecurityConstants;
import com.cjm.one.common.result.Result;
import com.cjm.one.coupon.client.CustomerCouponClient;
import com.cjm.one.model.coupon.dto.CouponReserveDto;
import com.cjm.one.model.coupon.entity.CustomerCoupon;
import com.cjm.one.model.coupon.vo.CouponInfoVo;
import com.cjm.one.service.CustomerCouponService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
@Service
public class CustomerCouponServiceImpl implements CustomerCouponService {
    @Resource
    private CustomerCouponClient customerCouponClient;
    @Override
    public Result<Page<CouponInfoVo>> getList(Long current, Long size, String keyWord, Integer rangeType) {
        return customerCouponClient.getList(current, size,keyWord, rangeType);

    }

    @Override
    public Result<Boolean> save(CustomerCoupon customerCoupon) {
        return customerCouponClient.save(customerCoupon);

    }

    @Override
    public Result<Boolean> autoReceive(CouponReserveDto couponReserveDto) {
        return customerCouponClient.autoReceive(couponReserveDto, SecurityConstants.FROM_SOURCE);
    }
}
